import basic from '../../../xc/model/basic.js';
var actmodel = new basic();
actmodel.do="distribution_team" 


actmodel.leaderaccumulated = function () {
  var app = getApp();
  var data = { "op": "leaderaccumulated" }
  return new Promise((resolve, reject) => {
    app.util.request({
      'url': 'entry/wxapp/' + actmodel.do,
      'data': data,
      'method': "get",
      showLoading: false,
      success: function (res) {
        if (res.data.errno == 0) {
          resolve(res.data.data);
        }
        reject(res.data.message);
      },
      fail: function (res) {
        reject(((res.data && res.data.message) ? res.data.message : res.errMsg));
      },
      complete: function () {
      }
    });
  });
}
actmodel.getstaticsdata = function (condition) {
  var app = getApp();
  var data = { "op": "getstaticsdata" ,condition:JSON.stringify(condition)}
  return new Promise((resolve, reject) => {
    app.util.request({
      'url': 'entry/wxapp/' + actmodel.do,
      'data': data,
      'method': "get",
      showLoading: false,
      success: function (res) {
        if (res.data.errno == 0) {
          resolve(res.data.data);
        }
        reject(res.data.message);
      },
      fail: function (res) {
        reject(((res.data && res.data.message) ? res.data.message : res.errMsg));
      },
      complete: function () {
      }
    });
  });
}
actmodel.accumulated = function () {
  var app = getApp();
  var data = { "op": "accumulated" }
  return new Promise((resolve, reject) => {
    app.util.request({
      'url': 'entry/wxapp/' + actmodel.do,
      'data': data,
      'method': "get",
      showLoading: false,
      success: function (res) {
        if (res.data.errno == 0) {
          resolve(res.data.data);
        }
        reject(res.data.message);
      },
      fail: function (res) {
        reject(((res.data && res.data.message) ? res.data.message : res.errMsg));
      },
      complete: function () {
      }
    });
  });
}
actmodel.nav=function(){
  var urlpara={op:"nav",do:actmodel.do}
  var data={};
 return this.post(urlpara,data) 
}
actmodel.areaorderlistoffset = function (that, reset, para, xcsorts) {
  if (!xcsorts) {
    xcsorts = [["createtime", "desc"]];
  }

  var acturlpara = {};
  acturlpara["url"] = "entry/wxapp/"+actmodel.do
  if (para) {
    para["op"] = "areaorderlistoffset"
  }
  else {
    this.wherepara["op"] = "areaorderlistoffset"
  }
  return actmodel.pagelist(acturlpara, that, reset, para, xcsorts);
}

actmodel.leaderorderoffset = function (that, reset, para, xcsorts) {
  if (!xcsorts) {
    xcsorts = [["createtime", "desc"]];
  }

  var acturlpara = {};
  acturlpara["url"] = "entry/wxapp/"+actmodel.do
  if (para) {
    para["op"] = "leaderorderoffset"
  }
  else {
    this.wherepara["op"] = "leaderorderoffset"
  }
  return actmodel.pagelist(acturlpara, that, reset, para, xcsorts);
}

actmodel.areaorderoffset = function (that, reset, para, xcsorts) {
  if (!xcsorts) {
    xcsorts = [["createtime", "desc"]];
  }

  var acturlpara = {};
  acturlpara["url"] = "entry/wxapp/"+actmodel.do
  if (para) {
    para["op"] = "areaorderoffset"
  }
  else {
    this.wherepara["op"] = "areaorderoffset"
  }
  return actmodel.pagelist(acturlpara, that, reset, para, xcsorts);
}

actmodel.distrorderoffset = function (that, reset, para, xcsorts) {
  if (!xcsorts) {
    xcsorts = [["createtime", "desc"]];
  }

  var acturlpara = {};
  acturlpara["url"] = "entry/wxapp/"+actmodel.do
  if (para) {
    para["op"] = "distrorderoffset"
  }
  else {
    this.wherepara["op"] = "distrorderoffset"
  }
  return actmodel.pagelist(acturlpara, that, reset, para, xcsorts);
}

actmodel.offset = function (that, reset, para, xcsorts) {
  if (!xcsorts) {
    xcsorts = [["createtime", "desc"]];
  }

  var acturlpara = {};
  acturlpara["url"] = "entry/wxapp/"+actmodel.do
  if (para) {
    para["op"] = "offset"
  }
  else {
    this.wherepara["op"] = "offset"
  }
  return actmodel.pagelist(acturlpara, that, reset, para, xcsorts);
}
module.exports = actmodel;